#include "common/pch.h"
#include "object/objectmgr.h"

#include "map/griddefines.h"
#include "metadata//creaturedata.h"

ObjectMgr::ObjectMgr()
{

}

void ObjectMgr::AddCreatureToGrid(unsigned int guid, mt::CreatureData const* data)
{
    CellPair cell_pair = map::grid::ComputeCellPair(data->posX, data->posY);
    unsigned int cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;

    CellObjectGuids& cell_guids = mMapObjectGuids[data->mapid][cell_id];
    cell_guids.creatures.insert(guid);
}